@extends('app')
@section('content')
<ul class="nav nav-tabs">
    <li><a href="{{ url('/admin/user')}}">考勤添加</a></li>
</ul>
<form id="userForm" method="post" action="" >
    <div class="panel panel-default description2 mt20">
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">用户名：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                @if(empty($att))
                    {{$user->name}}
                @else
                    {{getUserName($att->user_id)}}
                @endif
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">考勤月份：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                @if(empty($att))
                    {{$month-1}}
                    <input type="hidden" name="dateid" value="{{$month-1}}">
                @else
                    {{$att->date}}
                    <input type="hidden" name="dateid" value="{{$att->date}}">
                @endif
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">考勤详情：示例:1=迟到,4=早退,7=旷工</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                <textarea type="text" class="form-control" name="content"> @if(!empty($att)){{$att->content}}@endif</textarea>
            </div>
        </div>
        {!! csrf_field() !!}
        <input type="hidden" name="uid" value="@if(!empty($user)){{ $user->id }}@endif">
        <input type="hidden" name="blademode" value="{{$blademode}}">
        <input type="hidden" name="id" value="@if(!empty($att)){{ $att->id }}@endif">
        <input type="hidden" name="dataid" value="{{ $month-1 }}">
        <div class="form-inline">
            <div class="form-group">
              <button type="button" class="btn btn-info" onclick="saveData('/admin/attendence/att-store','userForm')">
                    <i class="icon-ok bigger-110"></i>
                    Submit
              </button>  
            </div>
        </div>
    </div>
</form>
<script>
    $('.list-group-item').eq(3).addClass('active');
</script>
@endsection
